
<!--initialize javascript for ajax-->

<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>
/js/admin-ajax.js"></script>

   

<?php
$this->title = "Daftar Admin";
$this->headTitle($this->title);
?>

<form>
<div id="view-content">
Cari :	<input type="text" size="10" value="" id="inputString" onkeyup="lookup(this.value,'list');"  />

</form>
<div class="tabledata" id="tabledata">
<table class="tablesorter">
    <tr class="top">

            <td colspan="3" style="text-align:left">                
<div class="add">
<a class="abutton" href="<?php echo $this->url(array("controller"=>"admin","action"=>"add")); ?>">
<img src="<?php echo $this->baseUrl(); ?>/images/icons/add.png" />Tambah</a>
</div>
            </td>
            <td colspan="5" style="text-align:right;">
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" /> = edit Admin &nbsp;&nbsp;&nbsp;
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" /> = hapus Admin
            </td>
 </tr>
<tr class="head">
    <td>
    <a class="sort"  href="<?=$this->url(array('controller'=>'admin',
            'action'=>'list', 'order'=>'admin_id','method'=>$this->method))?>">
    ID
    </a></td>
    <td>
     <a class="sort"  href="<?=$this->url(array('controller'=>'admin',
            'action'=>'list', 'order'=>'name','method'=>$this->method))?>">
    Name</a></td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'list', 'order'=>'username','method'=>$this->method))?>">
        Username</a></td>
    <td>
 <a class="sort" href="<?=$this->url(array('controller'=>'admin',
     'action'=>'list', 'order'=>'role_id','method'=>$this->method))?>">
     Jabatan</a></td>
    <td>
   <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'list', 'order'=>'email','method'=>$this->method))?>">
       Email</a></td>
    <td>
     <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'list', 'order'=>'phone','method'=>$this->method))?>">
    Nomor Telepon</a></td>
    <td>
    Keterangan</td>
    <td>&nbsp;</td>
</tr>
<span id="table-content">

<?php foreach($this->admins as $admin) : ?>
<tr style="background-color: <?= $this->cycle(array("#ccffcc","#99ff99"))->next(); ?>;">
    
    <td>  <a href="<?php echo $this->url(array('controller'=>'admin',
            'action'=>'details', 'id'=>$admin['admin_id']));?>">
        <?php echo $this->escape($admin['admin_id']);?></a>
    <td><?php echo $this->escape($admin['name']);?></td>
    <td><?php echo $this->escape($admin['username']);?></td>
    <td><?php echo $this->role->getRoleName($this->escape($admin['role_id']));?></td>
    <td><?php echo $this->escape($admin['email']);?></td>
    <td><?php echo $this->escape($admin['phone']);?></td>
    <td><?php echo $this->escape($admin['details']);?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'admin',
            'action'=>'edit', 'id'=>$admin['admin_id']));?>">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" alt="edit"/></a>
        <a href="javascript:deleting('<?php echo $this->url(array('controller'=>'admin',
            'action'=>'remove', 'id'=>$admin['admin_id']));?>')">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" alt="delete"></a>
    </td>
</tr>
<?php endforeach; ?>
<tr>
    <td colspan="7">
           <?= $this->back?>
            <?= $this->current?>/<?=$this->totalPages?>
          <?=$this->next?>
    </td>
</tr>
</span>
</table>
       </div>
</div>
